exports.handleE11000 = function(error, doc, next) {
  if (error.name === 'MongoError' && error.code === 11000) {
    // handle e11000
    console.log('e11000 MongoDB')
    next(error)
  } else {
    next()
  }
}

exports.handleErrAny = function(err, doc, next) {
  if (err && err.name === 'MongoError') {
    console.log('an unknown Mongo error happen')
    console.log(err)
  }
}
